function workerCode() {
	const _self = this.self
	_self.onmessage = (event) => {
		const array = new Array(20000000).fill(1)
		const arr = array.map((item, index) => {
			return index + 1
		})
		const end = new Date()

		postMessage(`hello world ${event.data.value} ${end - event.data.start}`)
	}
}

// 把脚本代码转为string
let code = workerCode.toString()
code = code.substring(code.indexOf('{') + 1, code.lastIndexOf('}'))

const blob = new Blob([code], { type: 'application/javascript' })
const worker_script = URL.createObjectURL(blob)

module.exports = worker_script
